package com.aitemv.services.impl;

import java.io.IOException;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.aitemv.base.BaseDao;
import com.aitemv.services.AdminAccService;
import com.aitemv.utils.PropertiesUtil;
@Service//(用于标注业务层组件)
public class AdminAccServiceImpl implements AdminAccService {

	@Autowired
	private BaseDao baseDao;

	public boolean login(String account, String password) {
		String sql = "";//定义查询的SQL
		try {
			sql = PropertiesUtil.load("admin_login");//从配置文件中取出SQL
		} catch (IOException e) {
			System.err.println("--管理员登录--exc");
			e.printStackTrace();
		}
		int countAcc = baseDao.isExist(sql, new String[] { account, password });//是否登录成功
		if (countAcc > 0) {
			return true;
		}
		return false;
	}

}
